void dectobin(int n) {
    if (n == 0) {
        printf("0");  
        return;
    }

    int bin[32];  
    int i = 0;

    while (n > 0) {
        bin[i] = n % 2; 
        n = n / 2; 
        i++;
    }
    for (int j = i - 1; j >= 0; j--) {
        printf("%d", bin[j]);
    }
}